<?php
namespace app\admin\model\menu;
use think\Model;
use think\admin\Db;

class MenuPermission extends Model {
	private $table_obj;
	
	public function selectMenuPermission($where,$field='*',$order=" id asc"){
		$menu=new MenuPermission;
		$data=$menu::where($where)->field($field)->select()->order($order);
		
		return $data->toArray();
	}
	/**
	 * 插入数据
	 * 
	 */
	public function insertMenuData($data){
		$admin=new MenuPermission;
		$admin->save($data);
		return $admin->id;
	}
	/**
	 * 更新数据
	 */
	public function updateMenuData($up,$where){
		$admin=MenuPermission::find($where);
		$r=$admin->save($up);
		return $r;
	}
	
	public function selectMenuData($where,$order,$limit){
		$data=MenuPermission::where($where)->limit(current($limit),next($limit))->order($order)->select();
		return $data->toArray();
	}
	
}
?>